package com.itsc.dao;

import java.util.List;

import org.hibernate.Query;

import com.itsc.entities.Permission;

@SuppressWarnings("unchecked")
public class PermissionDao extends BaseDao<Permission>{

	public List<Permission> selectAll(){
		String hql = "from Permission";
		Query query = getSession().createQuery(hql);
		List<Permission> list = query.list();
		return list;
	}
	
	public List<Permission> selectParentidNull(){
		String hql = "from Permission where parent_id=null";
		Query query = getSession().createQuery(hql);
		List<Permission> perList = query.list();
		return perList;
	}
}
